<div class="container main" style="margin-top: 40px;">

    <form class="form-horizontal myForm" id="myForm" action="" method="post">
        <strong class="st">员工转岗</strong>
        <span class="sp"><?=$user_info['user_name']?><em><?=$job_info['position_name']?>-<?=$user_info['p_name']?>-<?=$user_info['m_name']?>（<?=$dep_info['department_name']?>）</em></span>
        <input type="hidden" name="old_job_id" value="<?=$job_info['job_id']?>"/>
        <input type="hidden" name="old_p" value="<?=$user_info['p_level']?>"/>
        <input type="hidden" name="old_m" value="<?=$user_info['m_level']?>"/>
        <input type="hidden" name="work_id" value="<?=$work_info['work_id']?>"/>
        <fieldset>
            <div class="control-group fst">
                <label class="control-label"><em class="star">* </em>职位名称：</label>
                <div class="controls docs-input-sizes">
                    <input class="{required:true,messages:{required:'&nbsp;&nbsp;请填写职位名称！'}} input-big" id="input_type" type="text" />
                    <input type="hidden" name="new_job_id"/>
                    <input type="hidden" name="new_city"/>
                </div>
            </div>

            <div class="control-group">
                <label class="control-label">下级人数：</label>
                <div class="controls docs-input-sizes lin30">
                <?php if($sub_info['count']){?>
                        <a href="<?=$sub_info['url']?>" target="_blank"><?=$sub_info['count']?></a>
                    <?php }else{?>
                        <a href="javascript:void(0);"><?=$sub_info['count']?></a>
                    <?php }?>
                </div>
            </div>

            <div class="control-group">
                <label class="control-label">职称等级：</label>
                <div class="controls docs-input-sizes">
                    <select class="span2" name="new_p">
                        <option>-请选择-</option>
                        <?php foreach($p_list as $val){?>
                        <option value="<?=$val['id']?>" <?php if($val['id'] == $user_info['p_level']) echo 'selected';?>><?=$val['degree']?></option>
                        <?php }?>
                    </select><br/>
                    <select class="span2" style="margin: 8px 0 0;" name="new_m">
                        <option>-请选择-</option>
                        <?php foreach($m_list as $val){?>
                        <option value="<?=$val['id']?>" <?php if($val['id'] == $user_info['m_level']) echo 'selected';?>><?=$val['degree']?></option>
                        <?php }?>
                    </select>
                </div>
            </div>

            <div class="control-group">
                <label class="control-label"><em class="star">* </em>工作城市：</label>
                <div class="controls docs-input-sizes">
                    <input type="text" readonly="true" name="work_city" value="<?=$user_info['work_city_name']?>" class="{required:true,messages:{required:'&nbsp;&nbsp;请填写工作城市！'}} span1" style="float:left;"/>
                    <input type="hidden" name="old_city" value="<?=$user_info['work_city_id']?>"/>
                </div>
            </div>

            <div class="control-group">
                <label class="control-label"><em class="star">* </em>担任本职日期：</label>
                <div class="input-append" style="vertical-align: inherit;">
                    <input class="{required:true,messages:{required:'&nbsp;&nbsp;请选择担任本职日期！'}} span2" name="work_time" id="datepicker" type="text" style="float: left;" />
                    <span class="add-on" style="float: left;"><i class="icon-calendar"></i></span>
                </div>
            </div>

            <div class="control-group">
                <label class="control-label"><em class="star">* </em>直属上级：</label>
                <div class="input-append">
                    <input type="text" name="parent_input[]" value="<?php if($parent_info_is) echo $parent_info_is['parent_name'].' - '.$parent_info_is['position_name'];?>" class="{required:true,messages:{required:'&nbsp;&nbsp;请选择直属上级！'}} span3 search_name"  style="float: left;" placeholder="员工姓名 - 职位名称"  />
                    <input type="hidden" name="parent_id[]" value="<?=$parent_info_is['parent_id']?>"/>
                    <input type="hidden" name="parent_job[]" value="<?=$parent_info_is['parent_job_id']?>"/>
                    <input type="hidden" name="parent_direct[]" value ="1"/>
                </div>
            </div>

            <div class="control-group">
            <?php if($parent_info_no) $last_id = array_pop(array_keys($parent_info_no));//得到最后一个数组的KEY?>
            <?php if($parent_info_no){ foreach($parent_info_no as $index => $row){?>
                <div class="panel_conti">
                    <label class="control-label">虚线主管：</label>
                    <div class="input-append">
                        <input type="text" name="parent_input[]" value="<?php echo $row['parent_name'].' - '.$row['position_name'];?>" class="span3 search_name" style="margin: 0 auto;" placeholder="员工姓名 - 职位名称" />
                        <input type="hidden" name="parent_id[]" value="<?=$row['parent_id']?>"/>
                        <input type="hidden" name="parent_job[]" value="<?=$row['parent_job_id']?>"/>
                        <input type="hidden" name="parent_direct[]" value ="2"/>
                    </div>
                    <?php if($last_id == $index){?>
                    <a class="continueAdd" href="javascript:void(0);">+添加虚线主管</a>
                    <?php }?>
                </div>
            <?php }}else{?>
                <div class="panel_conti">
                    <label class="control-label">虚线主管：</label>
                    <div class="input-append">
                        <input type="text" name="parent_input[]" class="span3 search_name" style="margin: 0 auto;" placeholder="员工姓名 - 职位名称" />
                        <input type="hidden" name="parent_id[]" value=""/>
                        <input type="hidden" name="parent_job[]" value=""/>
                        <input type="hidden" name="parent_direct[]" value ="2"/>
                    </div>
                    <a class="continueAdd" href="javascript:void(0);">+添加虚线主管</a>
                </div>
            <?php }?>

            </div>
            <div class="control-group">
                <label class="control-label">&nbsp;</label>
                <input type="submit" value="保存" class="btn btn-primary" />
                <!--<input type="button" value="取消" class="btn" />-->
            </div>

        </fieldset>
    </form>

</div>


<?php $this->script_block_begin(); ?>
<script type="text/javascript">
    var ajaxUrl = '<?=Util_BaseUrls::ajax_search_user()?>';
    var ajaxUrl2 = '<?=Util_BaseUrls::ajax_search_job()?>';
</script>
<?php $this->script_block_end(); ?>